<!DOCTYPE html PUBLIC 
	"-//W3C//DTD XHTML 1.1 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	
<%@taglib prefix="s" uri="/struts-tags" %>
<s:set value="errorMessage" var="errorMsg"/>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Handicapper - Manage rating thresholds</title>
	<s:head />
</head>
<body>
    <s:if test="%{#errorMsg != null}">
        <div class="error">Error: <s:property value="errorMessage"/></div>
    </s:if>
    <s:form action="ratingThresholds" method="POST" >
        <label>Jockey rating thresholds:</label>
        <br />
        <table>
            <tr>
                <th>Name</th>
                <th>Leading</th>
                <th>Excellent</th>
                <th>Good</th>
                <th>Active</th>
                <th>Delete</th>
            </tr>
            <s:iterator var="t" value="thresholds">
                <s:set var="active">${t.active}</s:set>
                <tr>
                    <td>${t.name}</td>
                    <td>${t.leading}</td>
                    <td>${t.excellent}</td>
                    <td>${t.good}</td>
                    <s:if test="%{#active == 'true'}">
                        <td><input type="radio" name="activeThreshold" value="${t.name}" checked="checked" /></td>
                    </s:if>
                    <s:if test="%{#active != 'true'}">
                        <td><input type="radio" name="activeThreshold" value="${t.name}" /></td>
                    </s:if>
                    <s:if test="%{#active == 'true'}">
                        <td></td>
                    </s:if>
                    <s:if test="%{#active != 'true'}">
                        <td><input type="checkbox" name="deleteThreshold" value="${t.name}" /></td>
                    </s:if>
                </tr>
            </s:iterator>
        </table>
        <label>Create new thresholds:</label>
        Name: <input type="text" name="name" /><br />
        Leading: <input type="text" name="leading" /><br />
        Excellent: <input type="text" name="excellent" /><br />
        Good: <input type="text" name="good" /><br />
        <s:submit />
	</s:form>
</body>
</html>
	